#include "stdafx.h"

#include "BaseICtrl.h"
#include "Control/Container.h"


CBaseICtrl::CBaseICtrl(void)
	:CControl()
{
	Init();
}

CBaseICtrl::CBaseICtrl(UINT nID)
	:CControl( nID )
{
	Init();
}

CBaseICtrl::CBaseICtrl(wstring strCaption,UINT nID)
	:CControl( strCaption,nID )
{
	Init();
}

CBaseICtrl::CBaseICtrl(DWORD dwStyle,wstring strCaption, const CRect &rc, UINT nID )
	:CControl( dwStyle, strCaption, rc,nID )
{
	Init();
}

CBaseICtrl::CBaseICtrl(DWORD dwStyle, wstring strCaption, int x, int y, int cx, int cy, UINT nID )
	:CControl( dwStyle, strCaption, x, y, cx, cy,  nID )
{
	Init();
}

CBaseICtrl::~CBaseICtrl(void)
{
	//if( NULL!=m_pAlpRes )
	//{
	//	delete m_pAlpRes;
	//	m_pAlpRes = NULL;
	//}
}

void CBaseICtrl::Init()
{
	//m_pAlpRes = NULL;
	m_nLev = 0;
}

BOOL	CBaseICtrl::LoadRes( wstring strRes,CMyUnCompress* pPack )
{
	BOOL br = FALSE;
	//if ( m_pAlpRes==NULL )	
	//	m_pAlpRes = new CFAlphaRes();
	//br = m_pAlpRes->LoadResData( strRes,pPack );

	return br;
}

BOOL	CBaseICtrl::LoadStateRes( wstring strRes,int nState,CMyUnCompress* pPack )
{
   return LoadRes(  strRes, pPack );
}

void  CBaseICtrl::Paint(CDC* pDC)
{
	return;
}

void  CBaseICtrl::ImprovePaint( HANDLE hDB ,HDC hdc )
{
	if ( !IsVisible() || m_rcControl.IsRectEmpty() /*|| m_pAlpRes==NULL*/ )
		return ;
	
	//m_pAlpRes->Alpha16BppFastBlt( hDB,m_rcControl.TopLeft() );
}

void  CBaseICtrl::Click(DWORD dwClick, POINT pt)
{

}

CSize	CBaseICtrl::GetConBKSize()
{
	if ( m_pContainer )
		return m_pContainer->GetRect().Size();
	return CSize(0,0);
}

